#include <iostream>
using namespace std;

int n, s;

int main()
{
	ios::sync_with_stdio(false);
	cin >> n >> s;
	int ci, yi, min_c;
	long long ans = 0;
	cin >> ci >> yi;
	ans += yi * ci;
	min_c = ci;
	for (int i = 1; i < n; i++) {
		min_c += s;
		cin >> ci >> yi;
		min_c = min(min_c, ci);
		ans += yi*min_c;
	}
	cout << ans << "\n";
}

